package system

import (
	"5title_gin/internal/api/middleware"
	"5title_gin/internal/api/v1/system"
	"5title_gin/internal/model/system/dept"

	"github.com/gin-gonic/gin"
)

func SysDeptRouter(privateAPI *gin.RouterGroup, publicAPI *gin.RouterGroup) {

	app := system.NewDeptAPI()

	deptAPI := privateAPI.Group("/system/dept")

	{
		// 部门管理
		deptAPI.POST("/create",
			middleware.BindJsonMiddleware[dept.SysDeptBo],
			app.CreateDept)
		deptAPI.GET("/list",
			app.GetDeptList)
		deptAPI.GET("/getDeptOptions", app.GetDeptOptions)
		deptAPI.PUT("/update", middleware.BindJsonMiddleware[dept.SysDeptBo], app.UpdateDept)

	}
}
